/**
 * @author Justin Akin
 * @version Action Pals Core Library 0.1.0
 */
package com.actionpals.components.controls
{	
	import flash.events.MouseEvent;
	import com.actionpals.enum.Align;	
	
	/**
	 * 
	 */	public class VScrollBar extends SimpleScrollBar
	{
		
	//--------------------------------------------------------------------------------
	//
	//	Constructor
	//
	//--------------------------------------------------------------------------------
		
		/**
		 * Constructor
		 */
		public function VScrollBar( w:Number, h:Number, itemCount:int )
		{	
			_assetStackDirection = Align.BOTTOM;
			super( w, h );
		}
		
		/**
		 * 
		 */
		protected override function addListeners():void
		{	
			_arrowA.addEventListener( MouseEvent.CLICK, onArrowAClick );
			_arrowB.addEventListener( MouseEvent.CLICK, onArrowBClick );
			super.addListeners();
		}
		
		/**
		 * Event Handler for _arrowA click event
		 */
		protected function onArrowAClick( event:MouseEvent ):void
		{
			var percent:Number = _slider.percentFromTop - _percentInc;
			_slider.moveHandleToPercent( percent, Align.TOP );
		}
		
		/**
		 * Event Handler for _arrowA click event
		 */
		protected function onArrowBClick( event:MouseEvent ):void
		{
			var percent:Number = _slider.percentFromTop + _percentInc;
			_slider.moveHandleToPercent( percent, Align.TOP );
		}		
	}	
}